import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:shimmer/shimmer.dart';

class DAppTabItemSkeleton extends StatelessWidget {
  DAppTabItemSkeleton({super.key});

  @override
  Widget build(BuildContext context) {
    // TODO: implement build
    return SizedBox(
        width: 78.w,
        child: Shimmer.fromColors(
            baseColor: Color.fromRGBO(246, 246, 246, 1),
            highlightColor: Colors.grey.shade300,
            child: Container(
              height: 30.w,
              width: 56.w,
              decoration: BoxDecoration(
                borderRadius: BorderRadius.circular(8.w),
                color: Colors.grey,
              ),
            )));
  }
}

class DAppTabListPageItemSkeleton extends StatelessWidget {
  DAppTabListPageItemSkeleton({super.key});

  @override
  Widget build(BuildContext context) {
    return Container(
      width: double.infinity,
      padding:
          EdgeInsets.only(left: 20.w, right: 20.w, top: 12.w, bottom: 12.w),
      child: Row(
        children: [
          ClipRRect(
            borderRadius: BorderRadius.circular(50.w),
            child: Shimmer.fromColors(
                baseColor: Color.fromRGBO(246, 246, 246, 1),
                highlightColor: Colors.grey.shade300,
                child: Container(
                  height: 46.w,
                  width: 46.w,
                  decoration: BoxDecoration(
                    borderRadius: BorderRadius.circular(8.w),
                    color: Colors.grey,
                  ),
                )),
          ),
          SizedBox(
            width: 10.w,
          ),
          Expanded(
              flex: 1,
              child: Column(
                mainAxisAlignment: MainAxisAlignment.start,
                crossAxisAlignment: CrossAxisAlignment.start,
                children: [
                  Row(
                    children: <Widget>[
                      Shimmer.fromColors(
                          baseColor: Color.fromRGBO(246, 246, 246, 1),
                          highlightColor: Colors.grey.shade300,
                          child: Container(
                            height: 20.w,
                            width: 76.w,
                            decoration: BoxDecoration(
                              borderRadius: BorderRadius.circular(4),
                              color: Colors.grey,
                            ),
                          )),
                      SizedBox(
                        width: 3.w,
                      ),
                    ],
                  ),
                  SizedBox(
                    height: 3.w,
                  ),
                  Shimmer.fromColors(
                      baseColor: Color.fromRGBO(246, 246, 246, 1),
                      highlightColor: Colors.grey.shade300,
                      child: Container(
                        height: 16.w,
                        width: 219.w,
                        decoration: BoxDecoration(
                          borderRadius: BorderRadius.circular(4.w),
                          color: Colors.grey,
                        ),
                      ))
                ],
              ))
        ],
      ),
    );
  }
}
